#include<iostream>
using namespace std;

int main()
{
	int m, n;
	while (cin >> m >> n)
	{
		int* p = (int*)malloc(sizeof(int)*(m + 1)*(n + 1));
		*p = 0;
		for (int i = m; i > 0; i--)
			*(p + i) = 1;
		for (int i = n, j = 0; i > 0 && j < m; i--, j++)
			*(p + (n + 1)*j) = 1;
		for (int i = 1; i <= m;i++)
		 for (int j = 1; j <= n; j++)
		 {
			 *(p + m*j + i) = *(p + m*(j - 1) + i - 1);
		 }
		 cout <<*p((m+1)*(n+1)-1)
	}
	return 0;
}